package com.dc.seckill.dao;

import com.dc.seckill.domain.MiaoshaUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.dc.seckill.domain.User;

@Mapper
public interface UserDao {

	@Select("select * from user where id=#{id}")
	public User getById(@Param("id")int id);
	
	@Insert("insert into user (id,name) values(#{id},#{name}) ")
	public int insert(User user);

	@Insert("insert into miaosha_user (id,nickname,password,salt,register_date,last_login_date,login_count) " +
			"values (#{id},#{nickname},#{password},#{salt},#{registerDate},#{lastLoginDate},#{loginCount})")
	public void saveUser(MiaoshaUser miaoshaUser);
	
}
